﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System;
using UnityEngine.SceneManagement;

    public class WJGameHelper
    {
        public static bool isInit = false;

        public static string GetLanguage()
        {
            //Debug.Log(Application.systemLanguage.ToString());
            return Application.systemLanguage.ToString();
        }

        public static bool GetIsChinses() 
        {
            return GetLanguage().StartsWith("Chinese");
        }

       
        private static void DoLoadScene(int sceneIndex)
        {
            SceneManager.LoadScene(sceneIndex);
        }

        public static Color HexToColor(string hex)
        {
            byte r = byte.Parse(hex.Substring(0, 2), System.Globalization.NumberStyles.HexNumber);
            byte g = byte.Parse(hex.Substring(2, 2), System.Globalization.NumberStyles.HexNumber);
            byte b = byte.Parse(hex.Substring(4, 2), System.Globalization.NumberStyles.HexNumber);
            return new Color32(r, g, b, 255);
        }

        public static bool isAppleIPhoneX() 
        {
            Debug.Log((float)Screen.width / (float)Screen.height);
            return (float)Screen.width / (float)Screen.height >= 2;
        }

        public static bool isAppleIPad()
        {
            return (float)Screen.width / (float)Screen.height <= 1.5;            
        }
    }
